#ifndef DATAPANEL_H
#define DATAPANEL_H

#include <QFrame>
#include <QSharedPointer>

enum emComparisonCondition{
    LessThan,       //目标值小于阈值
    GreaterThan,    //目标值大于阈值
    EqualTo         //目标值等于阈值
};

namespace Ui {
class DataPanel;
}

class DataPanel : public QFrame
{
    Q_OBJECT
public:
    explicit DataPanel(QWidget *parent = nullptr);
    ~DataPanel();


public:
    void setBasicTemplate(QString bac_color,QString shadow_color,QString titel,QChar icon,QString unit,QString color = "#000000");
    void setStyle(QString bac_color,QString shadow_color,qint64 radius = 10);
    void setTitel(QString titel,QString color = "#000000");
    void setIcon(QChar icon,QString color = "#000000");
    void setValue(QString value,bool state);
    void setValue(QString value,int threshold,emComparisonCondition em_CCondition);
    void setUnit(QString unit,QString color = "#000000");

    void setPlugsToView(QWidget *widget);
private:
    Ui::DataPanel *ui;
    QString m_font_color;
};

#endif // DATAPANEL_H
